home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Diamond Collection
/
The Diamond Collection (Software Vault)(Digital Impact).ISO
/
cdr17
/
dwcook15.zip
/
COOKBOOK.DOC
next >
Wrap
Text File
|
1995-03-11
|
22KB
|
435 lines
DAVE'S COOKBOOK RECIPE PROGRAM
by Dave Woodall
***** IMPORTANT: *****
Always take great care of your cookbook (*.cbk) files. By this you
should back them up to a floppy disk often, and keep a copy of the disk
away from the house - you DON'T want to lose all your favorite recipes
and have no way to recover them. The best way is to trade cookbook files
with family members, so you'll have your recipes in case something bad
should happen to them. Always verify that you've entered a new recipe
correctly, and that it has been saved (to disk) and reloaded without
error BEFORE you throw away your paper copy.
COMMAND LINE SYNTAX:
cookbook - start the program (and don't load a .cbk file)
cookbook filename - load cookbook "filename"
NOTE: Cookbook files have a special format (outlined
below) and use a .cbk extension. When you specify a
filename, you may omit this and the program will add
it for you.
MAIN SCREEN FUNCTIONALITY:
Load Cookbook:
Use this to load a new cookbook into memory. If there were any recipes
in memory, they will be cleared out first (if any were changed, you will
be given the opportunity to save them first). You may also load a cook-
book when you start the program by typing "cookbook <filename>". The
default extension for a cookbook file is .cbk, and you may omit it. The
program will add it for you.
ASCII Import:
Using this function, you may add a new recipe to your cookbook
(collection of recipes in a file) by grabbing a text file off a disk,
and inserting it into your cookbook. It will be inserted before the
current recipe, or at the very beginning of the cookbook if you haven't
changed anything. The format that the recipe must follow is listed at the
end of this document in Appendix B.
Include Cookbook:
The Include and Extract functions are for trading recipes with others.
By including a cookbook file, the program will add all the new recipes
into memory, along with the ones currently there. They will be placed
before the current (last edited) recipe. If there are no recipes in
memory, this function acts just like a Load, except no filename is saved.
Basically, this is the same as an "Import" but imports my special binary
format (shown below) instead of an ASCII file).
Extract Cookbook:
The Extract function allows you to choose a few recipes, and create a
new cookbook file with them. You may select a group with the Search Recipe
function, or you may select a new group in this screen. Once you say "Ok",
the file will be written. You may at this point select to write the file
in plain ASCII instead of the binary .cbk format.
Save Cookbook:
Obvious. If the file doesn't exist, it is written automatically. If it
does, then you are given four options: 1) Overwrite - the old version of
the file is deleted and the new replaces it, 2) Backup - the old version is
renamed with a .bak extension, and the new file is written. If there
already is a .bak, it is first deleted. 3) Create new - you are given the
opportunity to give a new filename. 4) Abort - don't save any changes.
Edit A Recipe:
This button takes you immediately to the Recipe Edit Screen, where you
can edit, print, export, scale (etc.) the *current* recipe.
This screen was designed to allow you to enter your recipes very quickly.
Use the mouse to click on the field you want to enter, and go at it. You
may also use Tab and Shift-Tab to go forward and back. To advance out of
the Ingredients area, you MUST use the mouse. To enter a Fraction and the
Type for an ingredient, select one of the boxes on the top of the screen.
For an ingredient to be considered valid (and retained) you MUST enter an
Item name for each. If you omit the Type, "whole" will be used. If you
omit an amount (whole and fraction) a "1" will be used.
Other editing features: First off, hit F1 to flip to the Help screen.
This screen tells you all of the keyboard and mouse functions. Since the
keyboard's insert, delete and backspace keys are already used for inserting
and deleting characters, a few function keys are used for special editing.
These keys are:
Esc - abort all edits on current recipe - return to the previous menu.
F2 - clear current field.
F3 - delete current Ingredient or Instruction text line.
F4 - insert new Ingredient or Instruction text line.
What do you do with the Descriptor field? Use this for entering a
"condition" for the Item. So, if the recipe calls for "warmed milk"
or "sliced beef", put "warmed" or "sliced" in the Descriptor field. Why?
When you produce a Shopping List, the program will merge all the ingred-
ients from all the recipes you choose. What you want to know is how much
you need to buy. So for example, you don't want to see "1 chopped onion"
and "1 diced onion", you want to see 2 onions.
What about the Keyword field? You may well leave this blank if you
wish (it won't make any difference to the file size though). This is
to aid in searching through your recipes. If you mark all your pie recipes
with a "pie" keyword, you may later search for all recipes with a "pie"
keyword. This is a free-format line - enter as much as you want, in any
case.
If you want to print a recipe, just click on Print. If you want to make
a quadruple batch of something, first hit Scale, and enter a 4. Then hit
Print. Compare the print out to the original recipe!!! You may Scale your
recipes from 0.01 to 100.0 of their original size. NOTE: Some people say
that expanding or shrinking a recipe more than a factor of four (4.0) alters
the recipe, even though the correct proportions are maintained. So, just
keep this in mind when cooking for 100 (yeah, right).
If you want to Export this recipe to an ASCII file, click on Export.
You will be prompted for a filename, then the recipe is written to it.
To export a group of recipes, use the Search and Extract functions.
Use Next and Previous to move through the recipes, Insert to add a
recipe in front of the current recipe, and Delete to remove the currently
displayed recipe. Undo will get rid of ALL changes you have made to this
recipe since it has been displayed. Note that whenever you leave the
current recipe, changes are saved (in memory only). Use Done to exit back
to the previous menu.
TIP: If your cookbook becomes large, use the Search function to quickly
locate a desired recipe. Or, go into "Make Shopping List", and highlight
the recipe. Escape out to the Main Menu and select Edit. Your current
recipe is selected!
NOTE: Some recipes put a few (or all) of the ingredients in the
instructions area. You may do this if you wish, BUT by doing this, you
give up the ability to make Shopping Lists, and to Scale your recipes.
It is usually better to change the instructions to refer to the ingredients
that you place above.
What Can I Make?:
This feature allows you to input a list of ingredients, then will search
the cookbook for recipes that you can make with this list of ingredients.
The list of recipes that is returned will include those that contain other
ingredients as well as the ones you list. Like the Search function below,
you may click on a recipe in the list and jump into the Recipe Edit Screen.
Note: The ingredient names you enter on this screen are treated as
search "sub-strings". That means that if you type "butter" on one of the
lines, it will match not only butter, but "peanut butter" and "buttermilk".
This is to be expected (it's *not* a bug!) and allows more recipes to
match. It also allows "egg" to match "eggs" and other compares you wouldn't
like thrown out.
Sort Recipes:
The sort function allows you to reorder your recipes by one of the
following orders: 1) Author, 2) Title, or 3) Keywords. When sorting by
keywords, the program will sort them as one string (instead of a series
of keywords). For this reason, it is handy to make the first keyword
you list to be the most important.
If you want to sort primarily on Author, but have everything within
the Author sorted by Title, do two sorts - first by Title, then by
Author.
Search Recipes:
With the search function, you can say, "let me see all the recipes that
have cinnamon in them.". Or, "let me see all the recipes written by mom",
or "let me see all the cake recipes". Here's how to do it: When the
screen comes up, enter a search string like "cinnamon" or "mom" or "cake".
Then use the mouse to choose which parts of the recipes you want to
search through. Some don't make sense - like searching for "mom" in the
ingredients. The search is not case sensitive, so type what you like. Be
careful when specifying search strings, because you may miss recipes. For
example, a search string of "banana" will match "banana" and "bananas", but
"bananas" won't match "banana" (smaller search strings are able to match
more recipes).
Once you've got a list of matches, you can do a few things. You can
just quit back to the Main Menu (Done), you can kick off a New Search, or
(the really cool one) use the mouse to slide the list and click to select one
of the matches and flip over to the Edit Screen so you can Edit, Print or
Export it. You can even go into the Shopping List, and your selection
is retained!
Shopping List:
This is an interesting function. Here, you select a number of recipes
that you want to make (and for each you can specify a scaling factor).
After you finish choosing recipes, the program will go off and create a
single list of ingredients, sum all that are alike, and print a list of
required ingredients that you need to have to make the recipes you've
selected. You may also have the program print out the individual
recipes as well!
Configuration:
a) Colors:
To change the color of an item, you click on two items: 1) First,
click on the name of the item you want to change, then 2) click on
the color in the palette that you want that item to become. The
name of the item should become the color you have chosen. The
program also gives you complete control over setup of the palette
as well, so read the next paragraph before spending too much time
modifying your colors!
b) Palette:
Unlike most programs, this one will let you change the "palette"
or table of colors that you may choose from in your color selections.
Interestingly, when you change the color of a palette entry, *all*
items using that color will immediately change to the new color!
To change a palette entry, just click on the one you want to change.
A small menu will appear at the bottom of the screen. R G B stands
for Red, Green, and Blue, "i" stands for "intensity" and "b" stands
for "base". Below this line, is a string of "1"s and "0"s. A "1"
means that that portion of the color is included, and "0" means it
is not included. The "1" and "0" line will change to the current
settings as you modify them.
Clicking on a "base" portion adds a large amount of color, and clicking
on an "intensity" portion adds just a little. You can click on these
six settings as long as you like, then click on "Done" when finished.
If you experiment, you can find up to 8 shades of each color - although
it is not too practical for normal uses (a wider variety of colors is
usually more helpful).
TIPS:
1) Setup your palette *before* you select colors for certain
screen items.
2) Palette entry zero is the background of the screen.
3) Use palette entries 1-7 for screen items labeled "background".
Due to a quirk in DOS, if you use 8-15 for a background color,
and you choose a high intensity color, it will *not* appear
high intensity, and foreground colors used on top of it may
not show up correctly. You may use entries 1-7 for foreground
colors if you don't need all seven for backgrounds. There will
be no color conflicts in this case. Also, just because you
select a color for use in a background doesn't mean you can't
use it somewhere else in a foreground. Remember, you've got
15 colors to select, and 40 screen items that use them.
4) Don't set the pair of background and foreground colors (for the
same screen item) to the same or very close colors. This will
render the text *very* difficult to read. The best arrangement
is to make one light and another dark. But even that can be
taken too far - sometimes black on white or white on black can
be very hard on the eyes! (too much contrast)
c) Scrolling Delay:
Several of the Cookbook's functions use a scrolling window. Due to
the vast variety of machine configurations (and personal taste
differences), I added a delay setting. This setting is in milli-
seconds, and may be set anywhere from 1 to 2000 (2 seconds). To
set this to your liking, enter a value, hit the right mouse button
(exit the Configuration window) and go into Extract Cookbook. If
the list goes too fast, go back and increase this value. If too
slow, decrease it. This same value controls the scroll rate of all
scrolling windows.
d) Printer:
Click on the Printer keyword to change the printer setting. You may
put any text here (up to 15 characters), and the string will not be
checked. Normally, you will only use "LPT1" or "LPT2". You may also
put a file name here, and the program will write any text to the file
instead of the printer. Be careful not to enter a string that contains
illegal filename characters (like spaces), because the resulting name
of the file will not be deletable by normal DOS commands.
e) Defaults:
If you get your setups really confused, click on "Defaults" to reset
them to the pre-stored internal defaults. These are the settings in
effect when you first start up the program. Or, if you have a good
setup in COOKBOOT.DAT, and you want to abort the settings you've
just changed (and you haven't saved to COOKBOOK.DAT), just exit the
program and restart. If you're *really* hosed, exit to DOS, delete
the file COOKBOOK.DAT, and rerun the Cookbook.
f) Save File:
By making changes to your configuration, you are just changing what
is in memory at the current time. If you want to save these settings,
click on "Save File" and your current configuration will be saved to
"COOKBOOK.DAT" in the same directory as COOKBOOK.EXE. The next time
you start up the program, these values will be loaded automatically,
thus saving you setup time in future uses.
APPENDIX A: NOTES ON MEMORY USAGE:
This program will allocate memory as recipes are created and/or loaded.
During normal editing, memory can be lost as recipes are deleted or change
size. To avoid this, a simple memory management scheme is used: If a
recipe is edited, and the new size is the same size or smaller, then it
is placed in the same memory as before. If it has grown, then new memory
is allocated for it and the old is temporarily lost. After 15 of these
allocations have occured (I don't know, 15 seems like a good number), the
cookbook is written to a scratch file (xxxxcook.tmp), the entire heap is
released, then the cookbook is read back in fresh. This will ensure that
memory usage is maximized. However, this also means that you need to have
at least as much free disk space available as the size of your cookbook!
What makes a recipe take more memory? Two parts of each recipe are
variable, as you will see if you examine the .cbk file in Appendix C.
The two parts are 1) the ingredients (about 60 bytes for each) and 2) the
instructions area (1 byte per character). Recipes average about 820 bytes.
APPENDIX B: ASCII FILE FORMAT:
The ASCII File format that is Imported and Exported is detailed here.
Please note that it is "keyword" driven, which means that the keywords may
appear in any order. The only restriction is the "Title" keyword. "Title"
MUST appear as the first keyword in each recipe. This is so that you may
put several ASCII recipes into one file and Import them all at once.
Keywords: (may appear in any order - include the colon!)
Title: (must be first!!!)
Author:
Ingredients:
Keywords: (optional - left blank if omitted)
Instructions:
Other Notes:
1) Blank lines are ignored - use as many as you like.
2) Leading and trailing spaces are also ignored. You can line up items
into columns, or just leave a space or two. DON'T USE TAB CHARACTERS!
3) Ingredient lines must appear in the following order:
integer [fraction] type ingredient [(description)]
where:
integer - the whole number part of the quantity
[fraction] - the optional fraction - must be of type shown below:
1/16 1/8 1/6 1/4 1/3 1/2 2/3 3/4 5/6 7/8
(place *no* spaces in the fraction!)
type - measurement type - defaults to "whole" if illegal
teas. tbsp. oz(vol) cups pints quarts gallons
oz(wgt) pounds cans jars boxes other whole
ingredient - ASCII text ingredient name
[(description)] - optional description - must be in parentheses
Example ASCII file (1 recipe)
Title: Brownies
Author: Grandma Woodall
Keywords: brownies cake dessert cookies
Ingredients:
2 whole unsweetened chocolate (squares)
1 cups canola oil
2 cups sugar
3 whole eggs (large)
1 1/2 cups flour
1 teas. baking powder
1 teas. salt
1 cups broken nuts (optional)
Instructions:
Melt chocolate in oil (microwave), and add the rest in the order shown
making sure that the eggs don't cook in the warmed oil/chocolate. Before
adding the flour, mix the salt and baking powder into the flour - then
mix the flour mixture into the batter. Pour the completed mixture into
a greased and floured 9" x 13" cake pan. Bake at 350 F for 30 minutes.
(Note: If another recipe is to follow, it should start with the "Title:"
keyword.)
APPENDIX C: COOKBOOK FILE (.CBK) FORMAT:
#bytes: description:
------- -----------------------------------------------
8 ASCII signature 'cookbook' --+
2 num of remaining bytes in file hdr |
1 file major version (currently 1) |-- file header
1 file minor version (currently 0) |
2 number of recipes in cookbook (R): |
2 spare --+
2 num of remaining bytes in recipe -----------+
30 title of recipe in ASCII (null term) |
26 author of recipe in ASCII (null term) |
46 recipe keywords in ASCII (null term) |
1 flag 1 (unused in file) |
1 flag 2 (unused in file) |
2 number of ingredients (N): | repeat
| for R
3 whole num portion in ASCII --+ | recipes
1 null terminator | repeat |
2 coded value for fractional portion | for N |
2 coded value for measurement type | ingrd. |
26 descriptor in ASCII (null term) | |
26 ingrd. name in ASCII (null term) --+ |
|
2 num of total instruction ASCII chars (M) |
M instruction bytes: |
a) each line is NULL terminated -----------+
Coded values for fractions: Coded values for measurement types:
sixteenth = 1 teaspoon = 1 {volumes in tsps.}
eighth = 2 tablespoon = 3
sixth = 3 oz_v = 6
fourth = 4 cup = 48
third = 5 pint = 96
half = 6 quart = 192
two_thirds = 7 gallon = 768
three_fourths = 8 oz_w = 16 {weights in drams}
five_sixths = 9 pound = 256
seven_eighths = 10 can = -1 {"other" codes}
jar = -2
boxes = -3
other = -4
whole = -5